package com.gz.web.exception;


import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
//自定义异常
@ResponseStatus(reason = "年龄需要在1-120之间",value = HttpStatus.BAD_REQUEST) //400
public class AgeException extends RuntimeException {
    public AgeException() {}

    public AgeException(String message) {
        super(message); //这样的话可以在有@ExceptionHandler标识的方法中显示错误信息
    }
}
